// pages/goods/goods.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    ndicatorDots: true,
    autoplay: true,
    circular: true,
    interval: 3000,
    duration: 1000,
    swiperCurrent: 0,
    cateList: [
      {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t22228/270/207441984/11564/88140ab7/5b03fae3N67f78fe3.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t26635/320/1832919204/11533/a2f9878a/5bee366dN1627d554.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t1/17169/3/4127/4611/5c2f35cfEd87b0dd5/65c0cdc1362635fc.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t1/27962/13/1445/4620/5c120b24Edd8c34fe/43ea8051bc50d939.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t21481/263/412160889/15938/4246b4f8/5b0cea29N8fb2865f.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t16828/63/2653634926/5662/d18f6fa1/5b03b779N5c0b196f.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t26635/320/1832919204/11533/a2f9878a/5bee366dN1627d554.png',
        name: '分类'
      }, {
        url: 'http://m.360buyimg.com/mobilecms/s120x120_jfs/t16828/63/2653634926/5662/d18f6fa1/5b03b779N5c0b196f.png',
        name: '分类'
      }
    ],
    banners: [
      'http://static.ydcss.com/uploads/ydui/1.jpg',
      'http://static.ydcss.com/uploads/ydui/2.jpg',
      'http://static.ydcss.com/uploads/ydui/3.jpg'
    ],
    rec: [
      [
        {
          id: "8d7e52a51c",
          menu_logo: "http://bmob-cdn-15327.b0.upaiyun.com/2018/01/24/4058f32c40c49eca80327b5d61d814e8.jpg",
          menu_name: "PC 尼克尔 19mm f/4E ED",
          price: 999
        },
        {
          id: "e14ea37824",
          menu_logo: "http://bmob-cdn-15327.b0.upaiyun.com/2018/01/24/568de67d406f4b16800613cbc36b0f6a.png",
          menu_name: "卡西欧(CASIO)男表 G-SHOCK",
          price: 9299
        }
      ]
    ]
  },
  more: function () {
    wx.navigateTo({
      url: './shop/shop'
    })
  },
  router(e) {
    //跳转至商品详情页
    const id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: `/pages/good/index?id=${id}`
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  //图片轮播banner
  swiperChange: function (e) {
    this.setData({
      swiperCurrent: e.detail.current
    })
  },
})